import React from 'react';
import './css/course.less';
import http from '../../utils/http';
class AdminCourse extends React.Component {
  state = {
    appointList: [],
    listenedList: []
  }
  getCourse = () => {
    http
      .get('/course/find/own')
      .then(data => {
        this.setState({
          appointList: data
        })
      }, err => {
      })
  }
  // 初始化加载钩子
  componentDidMount() {
    this.getCourse()
  }
  render() {
    return (
      <div className="row">
        <div className="admin-course">
          <div className="fc-course">
            <table className="table table-striped">
              <tbody>
              {this.state.appointList.map((item, index) => (
                <tr key={index}>
                  <td>{item.courseBeginTime}-{item.courseEndTime}</td>
                  <td>{item.courseName}</td>
                  <td>{item.courseStatus}</td>
                </tr>
              ))}
              </tbody>
            </table>
          </div>
        </div>
      </div>
    );
  }
}
export default AdminCourse;